function doClose() {
    window.location.href = basePath + 'pfRole/page?t=' + new Date().getTime() + '&roleName=' + searchInfo.roleName +
    '&status=' + searchInfo.status + '&isvPid=' + searchInfo.isvPid + '&isvName=' + searchInfo.isvName +
    '&pageNo=' + searchInfo.pageNo + '&pageSize=' + searchInfo.pageSize;
}

function checkboxOnclick(obj,menuId){
    if($(obj).is(':checked')){
        $('input[menuId="'+ menuId + '"]').prop("checked",true);
    }else{
        $('input[menuId="'+ menuId + '"]').removeAttr("checked")
    }
}

//判断所有的单选按钮是否全不选
function checkAllBox(menuId){
    if($('input[menuId="'+ menuId + '"]').is(':checked')){
        $("#tabAllCheckBox" + menuId).prop("checked",true);
    }else{
        $("#tabAllCheckBox" + menuId).removeAttr("checked")
    }
}

function doSave() {
    var tabs=$('input[name="_tab"]:checked');
    var tabIds = '';
    tabs.each(function(idx,element){
        tabIds += $(element).val() + ',';
    });
    var postData = {
        id : searchInfo.id,
        tabIds : tabIds ? tabIds.substring(0, tabIds.length - 1) : '',
    }
    $.ajax({
        type: 'post',
        url: basePath + 'pfRole/saveTabRef?t=' + new Date().getTime(),
        dataType: 'json',
        data: postData,
        success : function (data) {
            if(data && data.isSuccess){
                doClose();
            }else if(data&&!data.isSuccess){
                toastr.error(data.message);
            }else{
                toastr.error('保存失败');
            }
        },
        error: function (request) {
            delayToastr('系统错误');
        }
    });
}